
#include <iostream>

#include "Vector3D.h"

using namespace std;
using namespace csci5229;

struct coord {
    double x, y, z;
};

int main (int argc, char *argv[])
{
    // points
    coord p[5] = { {0.0, 0.0, 0.0}, 
                   {1.0, 0.0, 0.0},
                   {0.0, 1.0, 0.0},
                   {0.0, 0.0, 1.0},
                   {1.0, 1.0, 1.0} };

    // vectors
    coord v[8] = { {1.0, 0.0, 0.0},
                   {0.0, 1.0, 0.0},
                   {0.0, 0.0, 1.0},
                   {5.0, 0.0, 0.0},
                   {0.0, 5.0, 0.0},
                   {0.0, 0.0, 10.0},
                   {1.5, 0.0, 1.0},
                   {-0.382, 1.175, 0.0} };

    // compute bounded vectors from two points
    for (int i=0; i < 4; i++)
    {
        Vector3D vect(p[i].x,   p[i].y,   p[i].z,
                      p[i+1].x, p[i+1].y, p[i+1].z);

        cout << "p["<<i  <<"] = ("<<p[i].x  <<","<<p[i].y  <<","<<p[i].z  <<") " 
             << "p["<<i+1<<"] = ("<<p[i+1].x<<","<<p[i+1].y<<","<<p[i+1].z<<") ";

        cout << vect << endl;
    }

    // 
    for (int i=0; i < 8-1; i++)
    {
        Vector3D vect1(v[i].x,   v[i].y,   v[i].z);
        Vector3D vect2(v[i+1].x, v[i+1].y, v[i+1].z);

        cout << vect1 << " dot    " << vect2 << " = " << vect1.dot(vect2) << endl;
        cout << vect1 << " cross  " << vect2 << " = " << vect1.cross(vect2) << endl;
        cout << vect1 << " crossN " << vect2 << " = " << vect1.crossN(vect2) << endl;
        cout << "norm(" << vect1 << ") cross norm(" << vect2 << ") = " << vect1.norm().cross(vect2.norm()) << endl;
        cout << "norm(" << vect1 << ") crossN norm(" << vect2 << ") = " << vect1.norm().crossN(vect2.norm()) << endl;
        cout << "norm(" << vect1 << ") = " << vect1.norm() << endl;
    }

    return 0;
}
